package service.Impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import qingke.bean.Page;
import qingke.mybatis.dao.ProductMapper;
import qingke.mybatis.pojo.Product;
import service.ProductService;

@Service("ProductService")
public class ProductServiceImpl implements ProductService {

	@Autowired
	private ProductMapper productMapper;

	@Override
	public List<Product> getAllProduct() {
		return this.productMapper.getAllProduct();
	}

	@Override
	public int countProducts() {
		return this.productMapper.countProducts();
	}

	@Override
	public List<Product> productPaging(Page page) {
		return this.productMapper.ProductPaging(page);
	}

	@Override
	public List<Product> getRecommendedProducts() {
		return this.productMapper.getRecommendedProducts();
	}

	@Override
	public Integer countProductsBySelect(String name) {
		return this.productMapper.countProductsBySelect(name);
	}

	@Override
	public List<Product> productPagingBySelect(Map<String, Object> map) {
		return this.productMapper.productPagingBySelect(map);
	}

	@Override
	public Product getProductById(Integer productId) {
		return this.productMapper.getProductById(productId);
	}

}
